package scau.hotel.hotel_service.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import scau.hotel.hotel_service.validator.IsChinese;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * (PricingRule)实体类
 *
 * @author makejava
 * @since 2022-03-28 20:26:00
 */
public class PricingRule implements Serializable {
    private static final long serialVersionUID = -27747934012750107L;
    /**
     * 定价规则
     */
    private Integer pricingRuleId;
    /**
     * 规则名称
     */
    @IsChinese(message = "规则名称请输入汉字")
    private String pricingRuleName;
    /**
     * 折扣，最多一位整数，两位小数
     */
    @Digits(integer = 1, fraction=2, message = "折扣格式不正确")
    @DecimalMin(value = "0.00", message = "折扣必须大于0.00")
    private BigDecimal discount;
    /**
     * 开始日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")
    private Date startDate;
    /**
     * 结束日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss")
    private Date endingDate;


    public Integer getPricingRuleId() {
        return pricingRuleId;
    }

    public void setPricingRuleId(Integer pricingRuleId) {
        this.pricingRuleId = pricingRuleId;
    }

    public String getPricingRuleName() {
        return pricingRuleName;
    }

    public void setPricingRuleName(String pricingRuleName) {
        this.pricingRuleName = pricingRuleName;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndingDate() {
        return endingDate;
    }

    public void setEndingDate(Date endingDate) {
        this.endingDate = endingDate;
    }

}

